home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / mtgrap1c / demo6.cpp < prev    next >
C/C++ Source or Header  |  1994-07-13  |  2KB  |  87 lines

  1. /*                                                            
  2.   ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  3.   ▒                                                          ▒
  4.   ▒                                                          ▒
  5.   ▒             Neuromancer's Graphics Library               ▒
  6.   ▒                     Version 1.0c                         ▒
  7.   ▒                                                          ▒
  8.   ▒  This program sets up a virtual screen. Flipping can     ▒
  9.   ▒  be done by setting the active page and flipping the     ▒ 
  10.   ▒  hidden page.                                            ▒ 
  11.   ▒                                                          ▒   
  12.   ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  13.   ▒                                                          ▒
  14.   ▒     Project:    MTLIB01.LIB                              ▒
  15.   ▒                 DEMO6.CPP                                ▒
  16.   ▒                                                          ▒ 
  17.   ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  18. */
  19.  
  20. #include <iostream.h>
  21. #include <stdlib.h> 
  22. #include <conio.h>
  23. #include "video.h"
  24. #include "rect.h"
  25. #include "bitmap.h"
  26.  
  27.  
  28. block page1;
  29.  
  30. void main(void)
  31. {
  32.  
  33.     mtSetVGAMode();            //Set up VGA Mode
  34.  
  35.     if ((page1=mtAllocPage(0,0,319,199)) == NULL)
  36.     {
  37.         mtSetTextMode();
  38.         cout <<"Error in setting up virtual screen 1\n"<< endl;
  39.         exit(0);
  40.     }
  41.     mtSetPage(PAGE_1);
  42.     mtClrScr(170);
  43.  
  44.     mtSetPage(PAGE_0);        //set active page to video screen
  45.     
  46.     mtSetWindow(15,15,304,184);    //set up clip region
  47.     mtClrScr(75);            //clear region to color 15
  48.  
  49.     while(!kbhit())
  50.     {
  51.         mtCPutPixel(random(320),random(200),random(256));
  52.     }
  53.  
  54.     getch();
  55.  
  56.     mtResetWindow();
  57.     mtClrScr(0);
  58.     
  59.     mtSetPage(PAGE_1);
  60.     
  61.     if (mtLoadPCX("pacman.dat")==0)
  62.     {
  63.         mtFreePage(page1);
  64.         mtSetTextMode();
  65.         exit(0);
  66.     }
  67.     
  68.     mtFlipPage(PAGE_1);        //Flip to video screen
  69.  
  70.     getch();
  71.     
  72.     mtFreePage(page1);
  73.     mtSetTextMode();
  74.  
  75.     cout << "Thank you for using the library!" << endl;
  76.  
  77.     exit(0);
  78.     
  79. }
  80.  
  81.            
  82.             
  83.  
  84.            
  85.  
  86.            
  87.